/*************************************************************************
 * TinySG, Copyright (C) 2007, 2008  J.D. Yamokoski
 * All rights reserved.
 * Email: yamokosk at gmail dot com
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of the License,
 * or (at your option) any later version. The text of the GNU Lesser General
 * Public License is included with this library in the file LICENSE.TXT.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE.TXT for
 * more details.
 *
 *************************************************************************/
/*
 * config.h
 *
 *  Created on: Nov 14, 2008
 *      Author: yamokosk
 */

//#ifndef CONFIG_H_
//#define CONFIG_H_

//----------------------------------------------------------------------------
// Logger settings
#if defined( TSG_HAVE_LOG4CXX )

#include <log4cxx/logger.h>
using namespace log4cxx;

#define ADD_LOGGING_SUPPORT				\
	static log4cxx::LoggerPtr logger;

#define INITIALIZE_LOGGER(classname)	\
	log4cxx::LoggerPtr classname::logger(log4cxx::Logger::getLogger(#classname));

#define TSG_LOG_INFO(expr)				\
	LOG4CXX_INFO(logger, expr);

#define TSG_LOG_WARN(expr)				\
	LOG4CXX_WARN(logger, __FUNCTION__ << "(): " << expr);

#define TSG_LOG_ERROR(expr)				\
	LOG4CXX_ERROR(logger, __FUNCTION__ << "(): " << expr);

#else

#include <iostream>
#include <cstdio>

#define ADD_LOGGING_SUPPORT

#define INITIALIZE_LOGGER(classname)

#define TSG_LOG_INFO(expr)

#define TSG_LOG_WARN(expr)				\
	std::cerr << __FUNCTION__ << "(): " << expr << std::endl;

#define TSG_LOG_ERROR(expr)				\
	std::cerr << __FUNCTION__ << "(): " << expr << std::endl;

#endif

//#endif
